package com.zm.authority.identity.controller;

import javax.annotation.Resource;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.zm.authority.identity.service.IdentityService;
import com.zm.base.core.exception.BaseException;
import com.zm.base.core.po.ZmResult;

/**
 * LoginController
 * @author DENG.ZHUO.HUI
 * @email 13751827792@163.com
 * @date 2017年4月18日
 * @version 1.0
 */
@Controller("loginController")
public class LoginController {
	
	private static Logger logger = Logger.getLogger(LoginController.class);  
	@Resource(name="identityService")
	private IdentityService identityService;
	
	@RequestMapping("/login")
	@ResponseBody
	public ZmResult login(String userId,String password,String rememberMe,String verifyCode){
		logger.debug("--> login <--");
		ZmResult result=null;
		try {
			result = identityService.login(userId, password, rememberMe, verifyCode);
		} catch (BaseException e) {
			e.printStackTrace();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return result;
	}
}
